cmake_minimum_required(VERSION 3.0.2)
project(LidarImuCali_cnu)

add_definitions(-w)

#set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_MODULE_PATH}/cmake ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
list( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake )
list( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules )

## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)

set(CMAKE_BUILD_TYPE "Release")
# set(CMAKE_BUILD_TYPE "Debug")
# set(FORCE_DEBUG_BUILD 1) 
#set(CMAKE_BUILD_TYPE "RelWithDebInfo")

set(CMAKE_CXX_FLAGS "-std=c++11")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -g -pthread")


# file(COPY configuration_files DESTINATION ${PROJECT_BINARY_DIR})

find_package(catkin REQUIRED COMPONENTS
  geometry_msgs
  nav_msgs
  sensor_msgs
  roscpp
  rosbag
  rospy
  std_msgs
  tf
  pcl_conversions
)

find_package(Eigen3 REQUIRED)
find_package(PCL REQUIRED)
find_package(Boost REQUIRED COMPONENTS system thread filesystem timer)
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})

FIND_PACKAGE( OpenMP REQUIRED) 
if(OPENMP_FOUND) 
  message("OPENMP FOUND") 
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") 
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") 
endif()


# catkin_package(
#   CATKIN_DEPENDS geometry_msgs nav_msgs roscpp rospy std_msgs
#   DEPENDS EIGEN3 PCL Boost
#   INCLUDE_DIRS include
# )

include_directories(
	${catkin_INCLUDE_DIRS} 
	${EIGEN3_INCLUDE_DIR}
  ${PCL_INCLUDE_DIRS})
include_directories(${Boost_INCLUDE_DIRS})

add_executable(main_imu_lidar_cali main_imu_lidar_cali.cpp  
      cali.cpp
      undistort.cpp
      ndtSlam.cpp
      )
target_link_libraries( main_imu_lidar_cali 
          ${catkin_LIBRARIES}
          ${PCL_LIBRARIES} 
          ndt_omp
          )